home *** CD-ROM | disk | FTP | other *** search
- // Copyright (C) 1997-2002 Alias|Wavefront,
- // a division of Silicon Graphics Limited.
- //
- // The information in this file is provided for the exclusive use of the
- // licensees of Alias|Wavefront. Such users have the right to use, modify,
- // and incorporate this code into other products for purposes authorized
- // by the Alias|Wavefront license agreement, without fee.
- //
- // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- // PERFORMANCE OF THIS SOFTWARE.
- //
- global proc rebuildMenu(string $tabs, string $window)
- {
- setParent LockingKeyable;
- menu -e -dai Object;
- setParent -m Object;
- string $selected[] = `ls -sl -tail 20`;
- int $numOfSelected = `size( $selected )`;
- if( $numOfSelected == 0 )
- {
- menuItem -l "Nothing selected";
- }
- else
- {
- for( $item in $selected )
- {
- string $command = "MenuSelect" + " " + `tabLayout -q -st $tabs` +
- " " + $item + " " + `tabLayout -q -st $tabs` + " " + $window;//$item;
- menuItem -c $command -l $item;
- }
- if( $numOfSelected == 20 ) {
- menuItem -l "<truncated>";
- }
- }
- }
-
-
-
- global proc MenuSelect(string $commandStr, string $selection, string $parent,
- string $window)
- {
- setParent LockingKeyable;
-
- int $childCount = `frameLayout -query -numberOfChildren $parent`;
- string $command = "";
-
- if (0 == $childCount)
- {
- $command = "PScreate" + $commandStr + "UI " + $parent + " " +
- $selection;
- }
- else
- {
- $command = "PSupdate" + $commandStr + "UI " + $parent + " " +
- $selection;
- }
-
- eval $command;
-
- string $command = "UpdateTab " + $selection + " LKtabs " + $window;
- tabLayout -e -preSelectCommand $command LKtabs;
-
- string $windowName = "Channel Control - " + $selection;
-
- window -e -t $windowName $window;
- }
-
- global proc UpdateTab(string $selection, string $parent, string $window)
- {
- setParent LockingKeyable;
- string $tabSelected = `tabLayout -q -st $parent`;
-
- string $command = "MenuSelect " + $tabSelected + " " + $selection + " " +
- $tabSelected + " " + $window;
- eval $command;
- // tabLayout -e -cc "" LKtabs;
- }
-
- global proc autoUpdateCC()
- {
- // don't do anything if the window is minimized
- //
- if ( `window -q -iconify LockingKeyable` ) {
- return;
- }
-
- string $command;
- string $selected[] = `ls -sl -tail 20`;
- int $numOfSelected = `size( $selected )`;
-
- setParent LockingKeyable;
-
-
- if ((!(`frameLayout -exists warnFrame`))&&( $numOfSelected != 0 )) {
-
- tabLayout -e -tv true LKtabs;
- string $command = "MenuSelect" + " " + `tabLayout -q -st LKtabs` +
- " " + $selected[$numOfSelected-1] + " " + `tabLayout -q -st LKtabs` + " " +
- "LockingKeyable";
-
- eval $command;
- } else if( $numOfSelected != 0 ) {
- if (`tabLayout -exists warnTab`) {
- deleteUI warnTab;
- }
- tabLayout -e -tv true LKtabs;
- tabLayout -e -st Keyable LKtabs;
- string $command = "MenuSelect" + " " + `tabLayout -q -st LKtabs` +
- " " + $selected[$numOfSelected-1] + " " + `tabLayout -q -st LKtabs` + " " +
- "LockingKeyable";
-
- eval $command;
- } else if (!`tabLayout -exists warnTab`) {
- setParent LockingKeyable;
- tabLayout warnTab;
- frameLayout -bv false -lv false -cll false warnFrame;
- frameLayout -lv false warnFrame;
- tabLayout -e -tv false warnTab;
- tabLayout -e -tv false LKtabs;
- tabLayout -e -st warnTab LKtabs;
- text -l "There is nothing selected." warning;
- }
-
- }
-
- global proc buildChannelControlContextHelpItems(string $nameRoot, string $menuParent)
- //
- // Description:
- // Build context sensitive menu items
- //
- // Input Arguments:
- // $nameRoot - name to use as the root of all item names
- // $menuParent - the name of the parent of this menu
- //
- // Return Value:
- // None
- //
- {
- menuItem -label "Help on Channel Control..."
- -enableCommandRepeat false
- -command "showHelp ChannelControl";
- }
-
- global proc lockingKeyableWnd()
- {
- string $selected[] = `ls -sl -tail 20`;
- int $numOfSelected = `size( $selected )`;
- if ( `window -exists LockingKeyable` ) {
- showWindow LockingKeyable;
- return;
- }
-
- window
- -mb true
- -w 500 -h 400
- -t "Channel Control"
- -iconName "Channels"
- -mnc "window -e -rc autoUpdateCC -mnc \"\" LockingKeyable"
- LockingKeyable;
-
-
-
- if(`about -mac`){
- menu -p LockingKeyable
- -l "Object"
- -pmc "rebuildMenu LKtabs LockingKeyable"
- -familyImage "menuIconObject.xpm"
- Object;
- }
-
- // Adds support for the Context Sensitive Help Menu.
- //
- addContextHelpProc "LockingKeyable" "buildChannelControlContextHelpItems";
- doHelpMenu "LockingKeyable" "LockingKeyable";
-
- setUITemplate -pushTemplate NONE;
-
- scriptJob -p LockingKeyable -e "SelectionChanged" "autoUpdateCC";
-
- tabLayout LKtabs;
-
- frameLayout -lv false Keyable;
- setParent ..;
-
- frameLayout -lv false Locking;
- setParent ..;
-
- tabLayout -e -tl Keyable "Keyable" -tl Locking "Locked" -tv false LKtabs;
- tabLayout -e -st Keyable LKtabs;
- tabLayout -e -tv false LKtabs;
-
- if(!`about -mac`){
- menu -p LockingKeyable
- -l "Object"
- -pmc "rebuildMenu LKtabs LockingKeyable"
- -familyImage "menuIconObject.xpm"
- Object;
- }
-
- if( $numOfSelected != 0 )
- {
- autoUpdateCC;
- }
- else
- {
- tabLayout warnTab;
- frameLayout -bv false -lv false -cll false warnFrame;
- frameLayout -lv false warnFrame;
- tabLayout -e -tv false warnTab;
- tabLayout -e -st warnTab LKtabs;
- text -l "There is nothing selected." warning;
- }
- setUITemplate -popTemplate;
-
- showWindow LockingKeyable;
- }
-